<div class="layui-card">
    <div class="layui-card-body">
        <form class="layui-form" action="" method="post" id="cp-form" enctype="multipart/form-data">
            <div class="layui-form-item">
                <label class="layui-form-label">标题 <span class="request-tips">*</span></label>
                <div class="layui-input-block">
                    <input type="text" name="title"  value="{$nav.title}" required lay-verify="required" placeholder="标题" autocomplete="off" class="layui-input">
                </div>
            </div>


            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button type="button" class="layui-btn" id="test1">
                        <i class="layui-icon">&#xe67c;</i>图标
                    </button>
                </div>
                <div class="layui-input-block">
                    <table class="layui-table" id="app-photo">
                        <tr>
                            <td>
                                <input type="text" class="layui-input" name="icon" value="">
                            </td>
                            <td>
                                <img src="{:_get_image_preview_url($nav.icon)}" alt="" width="150" >
                            </td>
                            <td>
                                <a href="javascript:;" class="layui-btn layui-btn-danger layui-btn-xs del-photos-btn">删除</a>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>


            <div class="layui-form-item">
                <label class="layui-form-label">链接 <span class="request-tips">*</span></label>
                <div class="layui-input-block">
                    <input type="text" name="url_link"  value="{$nav.url_link}" required lay-verify="required" placeholder="链接" autocomplete="off" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">排序 <span class="request-tips">*</span></label>
                <div class="layui-input-block">
                    <input type="text" name="sort"  value="{$nav.sort}" required lay-verify="required" placeholder="排序" autocomplete="off" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">访问状态 <span class="request-tips">*</span></label>
                <div class="layui-input-block">
                    <input type="radio" name="status" class="layui-input" title="开启" value="1" {if isset($nav.status) and $nav.status eq 1}checked{/if}>
                    <input type="radio" name="status" class="layui-input" title="禁用" value="0" {if isset($nav.status) and $nav.status eq 0}checked{/if}>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">是否推荐 <span class="request-tips">*</span></label>
                <div class="layui-input-block">
                    <input type="radio" name="is_reco" class="layui-input" title="开启" value="1" {if isset($nav.is_reco) and $nav.is_reco eq 1}checked{/if}>
                    <input type="radio" name="is_reco" class="layui-input" title="禁用" value="0" {if isset($nav.is_reco) and $nav.is_reco eq 0}checked{/if}>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">窗口对象 <span class="request-tips">*</span></label>
                <div class="layui-input-block">
                    <select name="target">
                        <option value="_self" {if isset($nav.target) and $nav.target eq '_self'}selected{/if}>当前窗口</option>
                        <option value="_blank" {if isset($nav.target) and $nav.target eq '_blank'}selected{/if}>新窗口</option>
                    </select>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">层级 <span class="request-tips">*</span></label>
                <div class="layui-input-block">
                    <input type="text"   value="{$level.title|default='一级导航'}" data-url="{:url('admin/system.nav/addanv')}"  id="level" required lay-verify="required" placeholder="层级" autocomplete="off" class="layui-input menuLevel">
                    <input type="hidden" name="pid" id="parent" value="{$nav.pid|default=0}">
                </div>
            </div>


            <div class="layui-form-item">
                <label class="layui-form-label">自定义内容 <span class="request-tips">*</span></label>
                <div class="layui-input-block">
                    <script id="container" type="text/plain" name="content" >{if isset($nav.content)}{$nav.content|raw}{else /}{/if}</script>
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <input type="hidden" name="id" value="{$nav.id}">
                    <input type="hidden" name="nav_id" value="{:request()->param('nav_id')}">
                    <div class="layui-text">带 * 号的为必填项</div>
                    <button class="layui-btn" lay-submit lay-filter="formDemo">保存</button>
                    <a href="javascript:history.go(-1);" class="layui-btn layui-btn-primary">返回</a>
                </div>
            </div>
        </form>
    </div>
</div>
